
package com.kly.enums;

/**
 * 推送所对接的api或供应商
 */
public enum PushAPIEnum {
    FCM(1, "FCM"),
    WEB_SOCKET(2, "WEB_SOCKET"),

    ;


    private PushAPIEnum(Integer id, String code) {
        this.id = id;
        this.code = code;
    }

    /**
     * app id
     */
    private Integer id;
    /**
     * app code
     */
    private String code;
    /**
     * app msg
     */
    private String msg;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static PushAPIEnum getAppNameById(Integer id) {
        PushAPIEnum[] appEnumps = PushAPIEnum.values();
        for (PushAPIEnum appEnum : appEnumps) {
            if (appEnum.getId().equals(id)) {
                return appEnum;
            }
        }
        return null;
    }
}
